package com.nbsaas.boot.manufacturing.rest.resource;

import com.nbsaas.boot.manufacturing.api.apis.ManufacturingOrderApi;
import com.nbsaas.boot.manufacturing.data.entity.ManufacturingOrder;
import com.nbsaas.boot.manufacturing.api.domain.request.ManufacturingOrderRequest;
import com.nbsaas.boot.manufacturing.api.domain.response.ManufacturingOrderResponse;
import com.nbsaas.boot.manufacturing.api.domain.simple.ManufacturingOrderSimple;
import com.nbsaas.boot.manufacturing.rest.convert.ManufacturingOrderSimpleConvert;
import com.nbsaas.boot.manufacturing.rest.convert.ManufacturingOrderEntityConvert;
import com.nbsaas.boot.manufacturing.rest.convert.ManufacturingOrderResponseConvert;
import com.nbsaas.boot.manufacturing.data.repository.ManufacturingOrderRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   生产订单-业务接口实现
*/
@Transactional
@Service
public class ManufacturingOrderResource extends BaseResource<ManufacturingOrder,ManufacturingOrderResponse, ManufacturingOrderSimple, ManufacturingOrderRequest>  implements ManufacturingOrderApi {

    @Resource
    private ManufacturingOrderRepository manufacturingOrderRepository;

    @Override
    public JpaRepositoryImplementation<ManufacturingOrder, Serializable> getJpaRepository() {
        return manufacturingOrderRepository;
    }

    @Override
    public Function<ManufacturingOrder, ManufacturingOrderSimple> getConvertSimple() {
        return new ManufacturingOrderSimpleConvert();
    }

    @Override
    public Function<ManufacturingOrderRequest, ManufacturingOrder> getConvertForm() {
        return new ManufacturingOrderEntityConvert();
    }

    @Override
    public Function<ManufacturingOrder, ManufacturingOrderResponse> getConvertResponse() {
        return new ManufacturingOrderResponseConvert();
    }




}


